using System;
using System.Data;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.ComponentModel;
using Easy.Geo.Kml;

namespace KmlGeneratorDemoWeb
{
    /// <summary>
    /// Summary description for WebService1
    /// </summary>
    [WebService(Namespace = "http://microsoft.com/webservices/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    public class WebService1 : System.Web.Services.WebService
    {

        [WebMethod]
        public Document BuscaPonto(string BBOX)
        {
            Document doc = new Document("Where are you?");
                        
            string[] points = BBOX.Split(',');

            float lat = float.Parse(points[3], Utils.KFloatFormatInfo);
            float lon = float.Parse(points[2], Utils.KFloatFormatInfo);
            Coordinate coord = new Coordinate(lat,lon,0);

            Placemark place = new Placemark("Here",coord);

            doc.AddFeature(place);

            return doc;
        }
    }
}
